package netty.coffee;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;

/**
 * @Author zhangtao
 * @create 2022/2/10 15:25
 */
public class DateUitl {
    public static long between(String from, String to) {
        DateTime d1 = DateTime.of(from, "yyyy-MM-dd HH:mm:ss");
        DateTime d2 = DateTime.of(to, "yyyy-MM-dd HH:mm:ss");
        return d1.between(d2).between(DateUnit.MINUTE);
    }

    public static void main(String[] args) {
        System.out.println(DateUitl.between("2021-11-29 16:10:34", "2021-11-29 16:08:35"));
    }
}
